<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>创建组件</title>
</head>

<body>
    <div id="app">
        <cpn></cpn>
    </div>

    <template id="cpn">
        <div>
            <h1>{{title}}</h1>
            <h2>haha</h2>
            <h3>xixixixixixi</h3>
        </div>
    </template>

    <script src="../vue/vue.js"></script>
    <script>
        Vue.component('cpn', {
            template: '#cpn',
            data() {
                return {
                    title: 'cpn组件'
                }
            },
        })
        const app = new Vue({
            el: '#app'
        });
    </script>
</body>

</html>